0 CpxTRS
↳1 NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxTRS
↳3 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxWeightedTrs
↳5 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳6 CpxTypedWeightedTrs
↳7 CompletionProof (UPPER BOUND(ID), 0 ms)
↳8 CpxTypedWeightedCompleteTrs
↳9 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 0 ms)
↳10 CpxRNTS
↳11 CompleteCoflocoProof (⇔, 155 ms)
↳12 BOUNDS(1, n^1)
f(X, n__g(X), Y) → f(activate(Y), activate(Y), activate(Y))
g(b) → c
b → c
g(X) → n__g(X)
activate(n__g(X)) → g(activate(X))
activate(X) → X
g(X) → n__g(X)
activate(n__g(X)) → g(activate(X))
b → c
activate(X) → X
f(X, n__g(X), Y) → f(activate(Y), activate(Y), activate(Y))
g(X) → n__g(X) [1]
activate(n__g(X)) → g(activate(X)) [1]
b → c [1]
activate(X) → X [1]
f(X, n__g(X), Y) → f(activate(Y), activate(Y), activate(Y)) [1]
g(X) → n__g(X) [1]
activate(n__g(X)) → g(activate(X)) [1]
b → c [1]
activate(X) → X [1]
f(X, n__g(X), Y) → f(activate(Y), activate(Y), activate(Y)) [1]
g :: n__g → n__g n__g :: n__g → n__g activate :: n__g → n__g b :: c c :: c f :: n__g → n__g → n__g → f |
f(v0, v1, v2) → null_f [0]
null_f, const
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
c => 0
null_f => 0
const => 0
activate(z) -{ 1 }→ X :|: X >= 0, z = X
activate(z) -{ 1 }→ g(activate(X)) :|: z = 1 + X, X >= 0
b -{ 1 }→ 0 :|:
f(z, z', z'') -{ 1 }→ f(activate(Y), activate(Y), activate(Y)) :|: Y >= 0, z'' = Y, z' = 1 + X, X >= 0, z = X
f(z, z', z'') -{ 0 }→ 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0
g(z) -{ 1 }→ 1 + X :|: X >= 0, z = X
eq(start(V, V1, V2),0,[g(V, Out)],[V >= 0]). eq(start(V, V1, V2),0,[activate(V, Out)],[V >= 0]). eq(start(V, V1, V2),0,[b(Out)],[]). eq(start(V, V1, V2),0,[f(V, V1, V2, Out)],[V >= 0,V1 >= 0,V2 >= 0]). eq(g(V, Out),1,[],[Out = 1 + X1,X1 >= 0,V = X1]). eq(activate(V, Out),1,[activate(X2, Ret0),g(Ret0, Ret)],[Out = Ret,V = 1 + X2,X2 >= 0]). eq(b(Out),1,[],[Out = 0]). eq(activate(V, Out),1,[],[Out = X3,X3 >= 0,V = X3]). eq(f(V, V1, V2, Out),1,[activate(Y1, Ret01),activate(Y1, Ret1),activate(Y1, Ret2),f(Ret01, Ret1, Ret2, Ret3)],[Out = Ret3,Y1 >= 0,V2 = Y1,V1 = 1 + X4,X4 >= 0,V = X4]). eq(f(V, V1, V2, Out),0,[],[Out = 0,V3 >= 0,V2 = V4,V5 >= 0,V = V3,V1 = V5,V4 >= 0]). input_output_vars(g(V,Out),[V],[Out]). input_output_vars(activate(V,Out),[V],[Out]). input_output_vars(b(Out),[],[Out]). input_output_vars(f(V,V1,V2,Out),[V,V1,V2],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. non_recursive : [g/2]
1. recursive [non_tail] : [activate/2]
2. non_recursive : [b/1]
3. recursive : [f/4]
4. non_recursive : [start/3]
#### Obtained direct recursion through partial evaluation
0. SCC is completely evaluated into other SCCs
1. SCC is partially evaluated into activate/2
2. SCC is completely evaluated into other SCCs
3. SCC is partially evaluated into f/4
4. SCC is partially evaluated into start/3
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations activate/2
* CE 6 is refined into CE [9]
* CE 5 is refined into CE [10]
### Cost equations --> "Loop" of activate/2
* CEs [10] --> Loop 6
* CEs [9] --> Loop 7
### Ranking functions of CR activate(V,Out)
* RF of phase [6]: [V]
#### Partial ranking functions of CR activate(V,Out)
* Partial RF of phase [6]:
- RF of loop [6:1]:
V
### Specialization of cost equations f/4
* CE 8 is refined into CE [11]
* CE 7 is refined into CE [12]
### Cost equations --> "Loop" of f/4
* CEs [12] --> Loop 8
* CEs [11] --> Loop 9
### Ranking functions of CR f(V,V1,V2,Out)
#### Partial ranking functions of CR f(V,V1,V2,Out)
### Specialization of cost equations start/3
* CE 2 is refined into CE [13]
* CE 3 is refined into CE [14]
* CE 4 is refined into CE [15]
### Cost equations --> "Loop" of start/3
* CEs [13,14,15] --> Loop 10
### Ranking functions of CR start(V,V1,V2)
#### Partial ranking functions of CR start(V,V1,V2)
Computing Bounds
=====================================
#### Cost of chains of activate(V,Out):
* Chain [[6],7]: 2*it(6)+1
Such that:it(6) =< Out
with precondition: [V=Out,V>=1]
* Chain [7]: 1
with precondition: [V=Out,V>=0]
#### Cost of chains of f(V,V1,V2,Out):
* Chain [9]: 0
with precondition: [Out=0,V>=0,V1>=0,V2>=0]
* Chain [8,9]: 6*s(2)+4
Such that:aux(1) =< V2
s(2) =< aux(1)
with precondition: [Out=0,V1=V+1,V1>=1,V2>=0]
#### Cost of chains of start(V,V1,V2):
* Chain [10]: 2*s(7)+6*s(9)+4
Such that:s(7) =< V
s(8) =< V2
s(9) =< s(8)
with precondition: []
Closed-form bounds of start(V,V1,V2):
-------------------------------------
* Chain [10] with precondition: []
- Upper bound: nat(V)*2+4+nat(V2)*6
- Complexity: n
### Maximum cost of start(V,V1,V2): nat(V)*2+4+nat(V2)*6
Asymptotic class: n
* Total analysis performed in 86 ms.